/**
 * @param {string} s
 * @return {string}
 */

var reverseWords = function (s) {
    return s.split(" ")
        .filter(item => item != "")
        .reverse().join(" ")
};
console.log(reverseWords("example   good a"))